﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.ObracunKamataProknjizen"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class ObracunKamataProknjizenEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// ComboBox for the IDKnjizenjeStavka property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDKnjizenjeStavka;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDKnjizenjeStavka property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDKnjizenjeStavkaLabel;
		
		/// <summary>
		/// ComboBox for the IDOrganizacija property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDOrganizacija;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDOrganizacija property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDOrganizacijaLabel;
		
		/// <summary>
		/// ComboBox for the IDObracunKamata property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDObracunKamata;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDObracunKamata property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDObracunKamataLabel;
		
		/// <summary>
		/// TextBox for the KontoSifraPrijenos property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxKontoSifraPrijenos;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the KontoSifraPrijenos property.
		/// </summary>
		protected System.Windows.Forms.Label uxKontoSifraPrijenosLabel;
		
		/// <summary>
		/// CheckBox for the DugIliPot property.
		/// </summary>
		protected System.Windows.Forms.CheckBox uxDugIliPot;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the DugIliPot property.
		/// </summary>
		protected System.Windows.Forms.Label uxDugIliPotLabel;
		
		/// <summary>
		/// TextBox for the Kontrola property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxKontrola;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Kontrola property.
		/// </summary>
		protected System.Windows.Forms.Label uxKontrolaLabel;
		#endregion
		
		#region Main entity
		private Entities.ObracunKamataProknjizen _ObracunKamataProknjizen;
		/// <summary>
		/// Gets or sets the <see cref="Entities.ObracunKamataProknjizen"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.ObracunKamataProknjizen"/> instance.</value>
		public Entities.ObracunKamataProknjizen ObracunKamataProknjizen
		{
			get {return this._ObracunKamataProknjizen;}
			set
			{
				this._ObracunKamataProknjizen = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxIDKnjizenjeStavka.DataBindings.Clear();
			this.uxIDKnjizenjeStavka.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDKnjizenjeStavka", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDOrganizacija.DataBindings.Clear();
			this.uxIDOrganizacija.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDOrganizacija", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDObracunKamata.DataBindings.Clear();
			this.uxIDObracunKamata.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDObracunKamata", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxKontoSifraPrijenos.DataBindings.Clear();
			this.uxKontoSifraPrijenos.DataBindings.Add("Text", this.uxBindingSource, "KontoSifraPrijenos", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxDugIliPot.DataBindings.Clear();
			this.uxDugIliPot.DataBindings.Add("Checked", this.uxBindingSource, "DugIliPot", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxKontrola.DataBindings.Clear();
			this.uxKontrola.DataBindings.Add("Text", this.uxBindingSource, "Kontrola", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="ObracunKamataProknjizenEditControlBase"/> class.
		/// </summary>
		public ObracunKamataProknjizenEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_ObracunKamataProknjizen != null) _ObracunKamataProknjizen.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxIDKnjizenjeStavka = new System.Windows.Forms.ComboBox();
			uxIDKnjizenjeStavkaLabel = new System.Windows.Forms.Label();
			this.uxIDOrganizacija = new System.Windows.Forms.ComboBox();
			uxIDOrganizacijaLabel = new System.Windows.Forms.Label();
			this.uxIDObracunKamata = new System.Windows.Forms.ComboBox();
			uxIDObracunKamataLabel = new System.Windows.Forms.Label();
			this.uxKontoSifraPrijenos = new System.Windows.Forms.TextBox();
			uxKontoSifraPrijenosLabel = new System.Windows.Forms.Label();
			this.uxDugIliPot = new System.Windows.Forms.CheckBox();
			uxDugIliPotLabel = new System.Windows.Forms.Label();
			this.uxKontrola = new System.Windows.Forms.TextBox();
			uxKontrolaLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIDKnjizenjeStavkaLabel
			//
			this.uxIDKnjizenjeStavkaLabel.Text = "IDKnjizenjeStavka:";
			this.uxIDKnjizenjeStavkaLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIDKnjizenjeStavkaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDKnjizenjeStavkaLabel);			
			//
			// uxIDKnjizenjeStavka
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDKnjizenjeStavka);
			this.uxIDKnjizenjeStavka.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxIDKnjizenjeStavka);
			//
			// uxIDOrganizacijaLabel
			//
			this.uxIDOrganizacijaLabel.Text = "IDOrganizacija:";
			this.uxIDOrganizacijaLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxIDOrganizacijaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDOrganizacijaLabel);			
			//
			// uxIDOrganizacija
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDOrganizacija);
			this.uxIDOrganizacija.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxIDOrganizacija);
			//
			// uxIDObracunKamataLabel
			//
			this.uxIDObracunKamataLabel.Text = "IDObracunKamata:";
			this.uxIDObracunKamataLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxIDObracunKamataLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDObracunKamataLabel);			
			//
			// uxIDObracunKamata
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDObracunKamata);
			this.uxIDObracunKamata.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxIDObracunKamata);
			//
			// uxKontoSifraPrijenosLabel
			//
			this.uxKontoSifraPrijenosLabel.Text = "KontoSifraPrijenos:";
			this.uxKontoSifraPrijenosLabel.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxKontoSifraPrijenosLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxKontoSifraPrijenosLabel);			
			//
			// uxKontoSifraPrijenos
			//
			this.uxKontoSifraPrijenos.Width = 250;
			this.uxKontoSifraPrijenos.MaxLength = 9;
			//this.uxTableLayoutPanel.Controls.Add(this.uxKontoSifraPrijenos);
			this.uxKontoSifraPrijenos.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxKontoSifraPrijenos);
			//
			// uxDugIliPotLabel
			//
			this.uxDugIliPotLabel.Text = "DugIliPot:";
			this.uxDugIliPotLabel.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxDugIliPotLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxDugIliPotLabel);			
			//
			// uxDugIliPot
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxDugIliPot);
			this.uxDugIliPot.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxDugIliPot);
			//
			// uxKontrolaLabel
			//
			this.uxKontrolaLabel.Text = "Kontrola:";
			this.uxKontrolaLabel.Location = new System.Drawing.Point(3, 130);
			this.Controls.Add(this.uxKontrolaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxKontrolaLabel);			
			//
			// uxKontrola
			//
			this.uxKontrola.Width = 250;
			this.uxKontrola.MaxLength = 31;
			this.uxKontrola.ReadOnly = true;
			//this.uxTableLayoutPanel.Controls.Add(this.uxKontrola);
			this.uxKontrola.Location = new System.Drawing.Point(160, 130);
			this.Controls.Add(this.uxKontrola);
			//
			// uxIDKnjizenjeStavka
			//				
			this.uxIDKnjizenjeStavka.DisplayMember = "IDKonto";	
			this.uxIDKnjizenjeStavka.ValueMember = "ID";	
			//
			// uxIDObracunKamata
			//				
			this.uxIDObracunKamata.DisplayMember = "IDKlijent";	
			this.uxIDObracunKamata.ValueMember = "ID";	
			//
			// uxIDOrganizacija
			//				
			this.uxIDOrganizacija.DisplayMember = "Naziv";	
			this.uxIDOrganizacija.ValueMember = "ID";	
			// 
			// ObracunKamataProknjizenEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "ObracunKamataProknjizenEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
				
		private Entities.TList<Entities.KnjizenjeStavka> _IDKnjizenjeStavkaList;
		
		/// <summary>
		/// The ComboBox associated with the IDKnjizenjeStavka property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.KnjizenjeStavka> IDKnjizenjeStavkaList
		{
			get {return _IDKnjizenjeStavkaList;}
			set 
			{
				this._IDKnjizenjeStavkaList = value;
				this.uxIDKnjizenjeStavka.DataSource = null;
				this.uxIDKnjizenjeStavka.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDKnjizenjeStavkaList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDKnjizenjeStavka property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDKnjizenjeStavkaList
		{
			get { return _allowNewItemInIDKnjizenjeStavkaList;}
			set
			{
				this._allowNewItemInIDKnjizenjeStavkaList = value;
				this.uxIDKnjizenjeStavka.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
				
		private Entities.TList<Entities.ObracunKamata> _IDObracunKamataList;
		
		/// <summary>
		/// The ComboBox associated with the IDObracunKamata property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.ObracunKamata> IDObracunKamataList
		{
			get {return _IDObracunKamataList;}
			set 
			{
				this._IDObracunKamataList = value;
				this.uxIDObracunKamata.DataSource = null;
				this.uxIDObracunKamata.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDObracunKamataList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDObracunKamata property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDObracunKamataList
		{
			get { return _allowNewItemInIDObracunKamataList;}
			set
			{
				this._allowNewItemInIDObracunKamataList = value;
				this.uxIDObracunKamata.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
				
		private Entities.TList<Entities.Organizacija> _IDOrganizacijaList;
		
		/// <summary>
		/// The ComboBox associated with the IDOrganizacija property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.Organizacija> IDOrganizacijaList
		{
			get {return _IDOrganizacijaList;}
			set 
			{
				this._IDOrganizacijaList = value;
				this.uxIDOrganizacija.DataSource = null;
				this.uxIDOrganizacija.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDOrganizacijaList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDOrganizacija property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDOrganizacijaList
		{
			get { return _allowNewItemInIDOrganizacijaList;}
			set
			{
				this._allowNewItemInIDOrganizacijaList = value;
				this.uxIDOrganizacija.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
